﻿CREATE proc [dbo].[SelectEntityAttRefs]
@entityIDs intlist readonly,
@attIDs intlist readonly
as
select av.ID, av.EntityID, av.AttID, av.ReferenceID
from AttRefs av
inner join @attIDs a on a.Value = av.AttID
inner join @entityIDs e on e.Value = av.EntityID